home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11422 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  61 lines

  1. Path: newsfeed.internetmci.com!panix!not-for-mail
  2. From: acinader@panix.com (Arthur Cinader Jr)
  3. Newsgroups: comp.lang.c,gnu.gcc.help
  4. Subject: CURSES ORA sample wont work, why?
  5. Date: 23 Mar 1996 22:16:31 -0500
  6. Organization: Panix
  7. Message-ID: <4j2eqf$7h3@panix.com>
  8. NNTP-Posting-Host: panix.com
  9.  
  10. I am trying to teach myself to program.  I want to do some
  11. simple character "drawing" to screen and curses should be good
  12. for the purpose.  I got O'Reilly Associates "Programing with
  13. curses" and have tried a slightly modified version of their
  14. init scr program...I am using gcc v2.6.  Here is the errors I
  15. am getting.  Other than stdin I have little experience with
  16. included libraries, so I am likely missing something
  17. obvious..please help if you can
  18.  
  19. % gcc -lcurses test.c
  20. test.c: In function `main':
  21. test.c:9: warning: passing arg 2 of `signal' makes pointer
  22. from integer without
  23. a cast
  24. /tmp/cc0016511.o: Undefined symbol _initscr referenced from text segment
  25. /tmp/cc0016511.o: Undefined symbol _stdscr referenced from text segment
  26. /tmp/cc0016511.o: Undefined symbol _box referenced from text segment
  27. /tmp/cc0016511.o: Undefined symbol _stdscr referenced from text segment
  28. /tmp/cc0016511.o: Undefined symbol _wgetch referenced from text segment
  29. /tmp/cc0016511.o: Undefined symbol _LINES referenced from text segment
  30. /tmp/cc0016511.o: Undefined symbol _COLS referenced from text segment
  31. /tmp/cc0016511.o: Undefined symbol _mvcur referenced from text segment
  32. /tmp/cc0016511.o: Undefined symbol _endwin referenced from text segment
  33.  
  34.  
  35. ****here is the source:
  36.  
  37. #include <curses.h>
  38. #include <signal.h>
  39.  
  40. main()
  41. {
  42.     int die();
  43.  
  44.     initscr();
  45.     signal(SIGINT, die);  /* This is causing a problem */
  46.     box(stdscr, '-','*');
  47.     getch();  /* This just pauses the program till I input */
  48.     die();
  49. }
  50.  
  51. die()
  52. {
  53.     signal(SIGINT, SIG_IGN);
  54.     mvcur(0, COLS -1, LINES -1, 0);
  55.     endwin();
  56.     exit(0);
  57. }
  58.  
  59.  
  60.  
  61.